<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/static/include/taglib.jsp"%>
<!DOCTYPE html >
<html>
<head>
 <meta name="viewport" content="width=device-width" />
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <title>后台管理--模板编辑</title>
 <link href="${ctxStatic}/layui/css/layui.css" rel="stylesheet" />
 <link href="${ctxStatic}/css/kpiuitanchu.css" rel="stylesheet" />
 <script src="${ctxStatic}/js/jquery-1.8.3.min.js?v=2.0" type="text/javascript"></script>
 <script src="${ctxStatic}/layui/layui.all.js"  type="text/javascript"></script>
    <script src="${ctxStatic}/js/common.js" type="text/javascript"></script>


  <style>
 .layui-form-danger {
    border-color: red !important;
}
 </style>
</head>
<body>
<form class="layui-form" id="formedit" name="formedit" action="add_attbmhz" method="post" target="d41d8cd98f00b204e9800998ecf8427e">
    <iframe name="d41d8cd98f00b204e9800998ecf8427e" src="about:blank" style="display:none;"></iframe>

     <div style="padding:10px ">
      <span style="font-size:12px;font-weight: bold;color:#ffffff">部门：</span>
      <span style="font-size:12px;font-weight: bold;color:#B8E986">${userentity.orgname }</span>
      <span style="font-size:12px;font-weight: bold;margin-left:50px;color:#ffffff">身份证号：</span>
      <span style="font-size:12px;font-weight: bold;color:#B8E986">${userentity.cardno }</span>
      <span style="font-size:12px;font-weight: bold;margin-left:50px;color:#ffffff">姓名：</span>
      <span style="font-size:12px;font-weight: bold;color:#B8E986">${userentity.realname }</span>
     </div>

     <div class="indexcontent" >
         <table nostyle="true"  cellspacing="0" cellpadding="0" border="0" class="layui-table" style="margin:0;">
          <col width="50px"></col>
         <!-- <col width="130px"></col>
          <col width="150px"></col>
          <col width="100px"></col> -->
          <col width="65px"></col>
          <col width="65px"></col>

          <col width="55px"></col>
          <col width="55px"></col>
          <col width="55px"></col>
          <col width="55px"></col>
          <col width="55px"></col>
          <col width="60px"></col>
          <col width="55px"></col>
          <col width="55px"></col>
          <col width="55px"></col>

          <col width="50px"></col>
          <col width="50px"></col>
          <col width="50px"></col>


          <col width="200px"></col>
          <col ></col>
              <thead>
                <tr>
                  <th rowspan="2">日期</th>
                  <!-- <th rowspan="2">单位</th>
                  <th rowspan="2">身份证号</th>
                  <th rowspan="2">姓名</th>-->
                  <th rowspan="2">是否出勤</th>
                  <th rowspan="2">是否加班</th>
                  <th colspan="9" style="padding-top:3px">未出勤</th>
                  <th rowspan="2">迟到</th>
                  <th rowspan="2">早退</th>
                  <th rowspan="2">旷工</th>
                  <th rowspan="2">备注</th>
                  <th rowspan="2"></th>
                </tr>
                <tr>
                 <th style="padding-top:3px">年休假</th>
                 <th style="padding-top:3px">探亲假</th>
                 <th style="padding-top:3px">婚假</th>
                 <th style="padding-top:3px">生育假</th>
                 <th style="padding-top:3px">丧假</th>
                 <th style="padding-top:3px">因公致伤</th>
                 <th style="padding-top:3px">病假</th>
                 <th style="padding-top:3px">事假</th>
                 <th style="padding-top:3px">其他</th>
                </tr>
              </thead>
         </table>

       <div class="selftable" id="selftable" style="height:340px">
         <table cellspacing="0" cellpadding="0" border="0" class="layui-table" style="margin:0;width:100%">
          <col width="50px"></col>
         <!--  <col width="130px"></col>
          <col width="150px"></col>
          <col width="100px"></col> -->
          <col width="65px"></col>
          <col width="65px"></col>

          <col width="55px"></col>
          <col width="55px"></col>
          <col width="55px"></col>
          <col width="55px"></col>
          <col width="55px"></col>
          <col width="60px"></col>
          <col width="55px"></col>
          <col width="55px"></col>
          <col width="55px"></col>

          <col width="50px"></col>
          <col width="50px"></col>
          <col width="50px"></col>
          <col width="200px"></col>
          <col ></col>
              <tbody>
               <c:forEach var="item" items="${list}" varStatus="idxStatus">
                <tr>
                 <td>${item.day}</td>
                 <td style="padding:0">
                  <c:if test="${item.sfcq==0 }">
                    <select name="sfcq_${item.attdetailid}"><option value="0" style="color:red">否</option><option value="1">是</option></select>
                  </c:if>

                  <c:if test="${item.sfcq==1}">
                    <select name="sfcq_${item.attdetailid}"><option value="1">是</option><option value="0">否</option></select>
                  </c:if>

                  </td>
                 <td style="padding:0">
                   <c:if test="${item.sfjb==0 }">
                    <select name="sfjb_${item.attdetailid}"><option value="0">否</option><option value="1">是</option></select>
                   </c:if>
                   <c:if test="${item.sfjb==1 }">
                    <select name="sfjb_${item.attdetailid}"><option value="1" style="color:red">是</option><option value="0">否</option></select>
                   </c:if>

                 </td>
                 <td>
                  <c:if test="${item.nxj==0 }">
                    <input value="${item.nxj}" name="nxj_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset" />
                  </c:if>
                  <c:if test="${item.nxj>0 }">
                    <input style="color:red" value="${item.nxj}" name="nxj_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset" />
                  </c:if>
                 </td>
                 <td>
                  <c:if test="${item.tqj==0 }">
                   <input value="${item.tqj}" name="tqj_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset"/>
                  </c:if>
                  <c:if test="${item.tqj>0 }">
                   <input style="color:red" value="${item.tqj}" name="tqj_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset"/>
                  </c:if>
                 </td>
                 <td>
                  <c:if test="${item.hj==0 }">
                    <input value="${item.hj}" name="hj_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset"/>
                  </c:if>
                  <c:if test="${item.hj>0 }">
                    <input style="color:red" value="${item.hj}" name="hj_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset"/>
                  </c:if>

                 </td>
                 <td>
                  <c:if test="${item.syj==0 }">
                     <input value="${item.syj}" name="syj_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset" />
                  </c:if>
                  <c:if test="${item.syj>0 }">
                     <input style="color:red" value="${item.syj}" name="syj_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset" />
                  </c:if>

                 </td>
                 <td>
                  <c:if test="${item.sj==0 }">
                    <input value="${item.sj}" name="sj_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset"/>
                  </c:if>
                  <c:if test="${item.sj>0 }">
                    <input  style="color:red" value="${item.sj}" name="sj_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset"/>
                  </c:if>

                 </td>
                 <td>
                  <c:if test="${item.ygzs==0 }">
                    <input value="${item.ygzs}" name="ygzs_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset"/>
                  </c:if>
                  <c:if test="${item.ygzs>0 }">
                    <input style="color:red" value="${item.ygzs}" name="ygzs_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset"/>
                  </c:if>

                 </td>
                 <td>
                  <c:if test="${item.bj==0 }">
                    <input value="${item.bj}" name="bj_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset"/>
                  </c:if>
                  <c:if test="${item.bj>0 }">
                    <input style="color:red" value="${item.bj}" name="bj_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset"/>
                  </c:if>

                 </td>
                 <td>
                  <c:if test="${item.shij==0 }">
                    <input value="${item.shij}" name="shij_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset" />
                  </c:if>
                  <c:if test="${item.shij>0 }">
                    <input style="color:red" value="${item.shij}" name="shij_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset" />
                  </c:if>

                 </td>
                 <td>
                  <c:if test="${item.qt==0 }">
                    <input value="${item.qt}" name="qt_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset" />
                  </c:if>
                  <c:if test="${item.qt>0 }">
                    <input style="color:red" value="${item.qt}" name="qt_${item.attdetailid}" class="layui-input layui-table-edit" lay-verify="tsset" />
                  </c:if>

                 </td>
                 <td style="padding:0">
                  <c:if test="${item.cd==0 }">
                   <select name="cd_${item.attdetailid}"><option value="0">否</option><option value="1">是</option></select>
                  </c:if>
                  <c:if test="${item.cd==1 }">
                   <select name="cd_${item.attdetailid}"><option value="1">是</option><option value="0">否</option></select>
                  </c:if>

                 </td>
                 <td style="padding:0">
                  <c:if test="${item.zt==0 }">
                   <select name="zt_${item.attdetailid}"><option value="0">否</option><option value="1">是</option></select>
                  </c:if>
                  <c:if test="${item.zt==1 }">
                   <select name="zt_${item.attdetailid}"><option value="1">是</option><option value="0">否</option></select>
                  </c:if>

                 </td>
                 <td style="padding:0">
                   <c:if test="${item.zt==0 }">
                    <select name="kg_${item.attdetailid}"><option value="0">否</option><option value="1">是</option></select>
                   </c:if>
                   <c:if test="${item.zt==1 }">
                    <select name="kg_${item.attdetailid}"><option value="1">是</option><option value="0">否</option></select>
                   </c:if>
                 </td>
                 <td style="padding:0"> <textarea style="min-height:100%" class="layui-textarea"  name="remark_${item.attdetailid}" >${item.remark}</textarea></td>
                 <c:if test="${idxStatus.index==0 }">
                   <td rowspan="${fn:length(list)}"></td>
                 </c:if>

                </tr>
               </c:forEach>

              </tbody>
            </table>
       </div>
     </div>


      <input type="hidden" name="detailids" value="${detailids}">
      <input type="hidden" name="attsummaryid" value="${attsummaryid}">



     <div style="width:90%;text-align: right;margin-top:10px;margin-right:100px">
   <button class="button" lay-submit="" lay-filter="demo1" id="btnsave">保存</button>
  <input type="button" class="button"  value="关闭" onclick="top.CloseOpenWindow()" />
 </div>

   </form>

  <script>
     $("#selftable").height($(window).height()-150);

     layui.use('form', function(){
  	   var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功
  	  form.verify({
  		tsset: function(value,demo){
   	     if(value==''){
   	      return '必填项不能为空';
   	     }
   	    var reg=/^[0-9]+([.]{1}[0-9]+){0,1}$/;
   	 if (!reg.test(value)){
   		 return '必须是数字';
   	 }

   	     var maxscore=1;
   	     if(value>maxscore){
      	      return '数值不能大于1';
      	     }

   	     if(value!=0&&value!=0.5&&value!=1){
   	    	 return '数值只能是为：0、0.5、1';
   	     }
   	    }})

  	   form.render();
   });

     $(".layui-table-edit").dblclick(function(){
    	 var value=Number($(this).val());
    	if(value>=1){
    		value=0.0;
    		$(this).val(0.0);
    	}
    	else{
    		$(this).val(value+0.5);
    	}
     })

     function CloseDialog(result,msg){
      	  top.frames["iframe"].vAttBmHz.addresult(result,msg);
        }
   </script>
</body>
</html>